

use "$data/clean/clean_main_complete.dta" , replace



		   
loc experiments " comment_any comment_nonsense  comment_constructive comment_length_wins"

		   
		   
preserve

clear all
eststo clear
estimates drop _all

set obs 10
qui gen x = 1
qui gen y = 1

loc columns = 0

foreach choice in `experiments'   {

    loc ++columns
    qui eststo col`columns': reg x y

}

restore


/* Statistics */

loc colnum = 1
loc colnames ""


foreach choice in `experiments' {

/* Statistics */



 
 
********************************Panel A*****************************************

	
	
 xi: reg `choice' voice_instrumental_pooled   , vce(r) // 
   
   
   
    sigstar voice_instrumental_pooled , prec(3)
    estadd loc thisstat3 = "`r(bstar)'": col`colnum'
    estadd loc thisstat4 = "`r(sestar)'": col`colnum'
   

		 
	qui sum `choice' if voice_instrumental_pooled==0
	estadd loc thisstat6 = string(`r(mean)', "%9.2f"): col`colnum'
	
	    loc ++colnum
}

	
loc colnum = 1
loc colnames ""	
	
foreach choice in `experiments' {	


	
 xi: reg `choice' feedback_pooled    , vce(r) // 
   
   
   
    
    sigstar feedback_pooled  , prec(3)
    estadd loc thisstat10 = "`r(bstar)'": col`colnum'
    estadd loc thisstat11 = "`r(sestar)'": col`colnum'
   

		 
	qui sum `choice' if no_feedback_pooled==1
	estadd loc thisstat13 = string(`r(mean)', "%9.2f"): col`colnum'
	
	qui sum `choice' 
    estadd loc thisstat14 = string(`r(N)', "%9.0f"): col`colnum'
	
	
	
    estadd loc thisstat15 = "X" : col`colnum'
	
    loc ++colnum

	
	}
	

	 

loc rowlabels " "\textbf{Panel A: Type of voice} " "  " "Instrumental" " " " "   " \hline Intrinsic group  mean"  " \hline"  "\textbf{Panel B: Feedback announcement} " "  " "Feedback announcement" " " " " " \hline No feedback group mean" "Number of Observations" "Controls" "

loc rowstats ""

forval i = 1/14 {
    loc rowstats "`rowstats' thisstat`i'"
}



esttab col* using "$output/treat_length_2panel_nocont.tex", replace cells(none) booktabs nonotes   num compress alignment(c) nogap noobs nobaselevels label stats(`rowstats', labels(`rowlabels')) ///
mtitle("Any comment" "Nonsense comment" "Constructive comment" "Length (characters)" )


